//**************************************************************************************************************
// CLASS: InstrTypeRI
//
// DESCRIPTION
// A type RI instruction is one that encodes a register and an integer. All such instructions are instances of
// this class. InstrTypeRI is derived from InstrTypeR.
//
// AUTHOR INFORMATION
// Group 2
// Tyler Williams
// Lauren Walker
// Cameron Stewart
// Fatimah Alowah
//**************************************************************************************************************
// Preprocessor guard.
#ifndef INSTRTYPERI_HPP
#define INSTRTYPERI_HPP

#include <string>
#include "Integer.hpp"
#include "InstrTypeR.hpp"
#include "Instr.hpp"

//==============================================================================================================
// CLASS: InstrTypeRI (derived from InstrTypeR)
//==============================================================================================================
class InstrTypeRI : public InstrTypeR {

public:
    //==========================================================================================================
    // PUBLIC FUNCTION MEMBERS:
    //==========================================================================================================
// Write the class declaration.
    //----------------------------------------------------------------------------------------------------------
    // Default ctor.
    //----------------------------------------------------------------------------------------------------------
    InstrTypeRI
        (
        );

    //----------------------------------------------------------------------------------------------------------
    // Constructor. A type RI instruction has a mnemonic and an integer.
    //----------------------------------------------------------------------------------------------------------
    InstrTypeRI
        (
   	std::string const& pMnemonic,
    	Register const&       pRegister,
    	Integer const&	 pInteger
        );

    //----------------------------------------------------------------------------------------------------------
    // Copy ctor.
    //----------------------------------------------------------------------------------------------------------
    InstrTypeRI
        (
        InstrTypeRI const& pInstr
        );

    //----------------------------------------------------------------------------------------------------------
    // Virtual dtor.
    //----------------------------------------------------------------------------------------------------------
    virtual ~InstrTypeRI
        (
        );

    //----------------------------------------------------------------------------------------------------------
    // Encode()
    //----------------------------------------------------------------------------------------------------------
    virtual void Encode
        (
        );

    //----------------------------------------------------------------------------------------------------------
    // GetInteger()
    //----------------------------------------------------------------------------------------------------------
    Integer GetInteger
        (
        )
        const;

    //----------------------------------------------------------------------------------------------------------
    // operator=()
    //----------------------------------------------------------------------------------------------------------
    InstrTypeRI& operator=
        (
        InstrTypeRI const& pInstr
        );

protected:
    //==========================================================================================================
    // PROTECTED UNCTION MEMBERS:
    //==========================================================================================================

    //----------------------------------------------------------------------------------------------------------
    // Copy()
    //----------------------------------------------------------------------------------------------------------
    void Copy
        (
        InstrTypeRI const& pInstr
        );

    //----------------------------------------------------------------------------------------------------------
    // SetInteger()
    //----------------------------------------------------------------------------------------------------------
    void SetInteger
        (
        Integer const& pInteger
        );

private:
    //==========================================================================================================
    // PRIVATE DATA MEMBERS:
    //==========================================================================================================
    Integer mInteger;
};


// End preprocessor guard.
#endif
